home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 January: Mac OS SDK / Dev.CD Jan 00 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / CMScriptingPlugin.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  5.1 KB  |  124 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        CMScriptingPlugin.h
  3.  
  4.      Contains:    ColorSync Scripting Plugin API
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __CMSCRIPTINGPLUGIN__
  19. #define __CMSCRIPTINGPLUGIN__
  20.  
  21. #ifndef __FILES__
  22. #include <Files.h>
  23. #endif
  24. #ifndef __CMAPPLICATION__
  25. #include <CMApplication.h>
  26. #endif
  27. #ifndef __CODEFRAGMENTS__
  28. #include <CodeFragments.h>
  29. #endif
  30.  
  31.  
  32.  
  33.  
  34.  
  35. #if PRAGMA_ONCE
  36. #pragma once
  37. #endif
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46.  
  47. #if PRAGMA_STRUCT_ALIGN
  48.     #pragma options align=mac68k
  49. #elif PRAGMA_STRUCT_PACKPUSH
  50.     #pragma pack(push, 2)
  51. #elif PRAGMA_STRUCT_PACK
  52.     #pragma pack(2)
  53. #endif
  54.  
  55.  
  56. enum {
  57.                                                                 /* ColorSync Scripting AppleEvent Errors */
  58.     cmspInvalidImageFile        = -4220,                        /* Plugin cannot handle this image file type */
  59.     cmspInvalidImageSpace        = -4221,                        /* Plugin cannot create an image file of this colorspace */
  60.     cmspInvalidProfileEmbed        = -4222,                        /* Specific invalid profile errors */
  61.     cmspInvalidProfileSource    = -4223,
  62.     cmspInvalidProfileDest        = -4224,
  63.     cmspInvalidProfileProof        = -4225,
  64.     cmspInvalidProfileLink        = -4226
  65. };
  66.  
  67.  
  68. /**** embedFlags field  ****/
  69. /* reserved for future use: currently 0 */
  70.  
  71. /**** matchFlags field  ****/
  72.  
  73. enum {
  74.     cmspFavorEmbeddedMask        = 0x00000001                    /* if bit 0 is 0 then use srcProf profile, if 1 then use profile embedded in image if present*/
  75. };
  76.  
  77.  
  78. typedef CALLBACK_API_C( CMError , ValidateImageProcPtr )(const FSSpec *spec);
  79. typedef CALLBACK_API_C( CMError , GetImageSpaceProcPtr )(const FSSpec *spec, OSType *space);
  80. typedef CALLBACK_API_C( CMError , ValidateSpaceProcPtr )(const FSSpec *spec, OSType *space);
  81. typedef CALLBACK_API_C( CMError , EmbedImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, CMProfileRef embedProf, UInt32 embedFlags);
  82. typedef CALLBACK_API_C( CMError , MatchImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, UInt32 qual, UInt32 srcIntent, CMProfileRef srcProf, CMProfileRef dstProf, CMProfileRef prfProf, UInt32 matchFlags);
  83. typedef STACK_UPP_TYPE(ValidateImageProcPtr)                     ValidateImageUPP;
  84. typedef STACK_UPP_TYPE(GetImageSpaceProcPtr)                     GetImageSpaceUPP;
  85. typedef STACK_UPP_TYPE(ValidateSpaceProcPtr)                     ValidateSpaceUPP;
  86. typedef STACK_UPP_TYPE(EmbedImageProcPtr)                         EmbedImageUPP;
  87. typedef STACK_UPP_TYPE(MatchImageProcPtr)                         MatchImageUPP;
  88. enum { uppValidateImageProcInfo = 0x000000F1 };                 /* 4_bytes Func(4_bytes) */
  89. enum { uppGetImageSpaceProcInfo = 0x000003F1 };                 /* 4_bytes Func(4_bytes, 4_bytes) */
  90. enum { uppValidateSpaceProcInfo = 0x000003F1 };                 /* 4_bytes Func(4_bytes, 4_bytes) */
  91. enum { uppEmbedImageProcInfo = 0x00003FF1 };                     /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  92. enum { uppMatchImageProcInfo = 0x003FFFF1 };                     /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  93. #define NewValidateImageProc(userRoutine)                         (ValidateImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppValidateImageProcInfo, GetCurrentArchitecture())
  94. #define NewGetImageSpaceProc(userRoutine)                         (GetImageSpaceUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetImageSpaceProcInfo, GetCurrentArchitecture())
  95. #define NewValidateSpaceProc(userRoutine)                         (ValidateSpaceUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppValidateSpaceProcInfo, GetCurrentArchitecture())
  96. #define NewEmbedImageProc(userRoutine)                             (EmbedImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppEmbedImageProcInfo, GetCurrentArchitecture())
  97. #define NewMatchImageProc(userRoutine)                             (MatchImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMatchImageProcInfo, GetCurrentArchitecture())
  98. #define CallValidateImageProc(userRoutine, spec)                 CALL_ONE_PARAMETER_UPP((userRoutine), uppValidateImageProcInfo, (spec))
  99. #define CallGetImageSpaceProc(userRoutine, spec, space)         CALL_TWO_PARAMETER_UPP((userRoutine), uppGetImageSpaceProcInfo, (spec), (space))
  100. #define CallValidateSpaceProc(userRoutine, spec, space)         CALL_TWO_PARAMETER_UPP((userRoutine), uppValidateSpaceProcInfo, (spec), (space))
  101. #define CallEmbedImageProc(userRoutine, specFrom, specInto, embedProf, embedFlags)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppEmbedImageProcInfo, (specFrom), (specInto), (embedProf), (embedFlags))
  102. #define CallMatchImageProc(userRoutine, specFrom, specInto, qual, srcIntent, srcProf, dstProf, prfProf, matchFlags)  CALL_EIGHT_PARAMETER_UPP((userRoutine), uppMatchImageProcInfo, (specFrom), (specInto), (qual), (srcIntent), (srcProf), (dstProf), (prfProf), (matchFlags))
  103.  
  104. #if PRAGMA_STRUCT_ALIGN
  105.     #pragma options align=reset
  106. #elif PRAGMA_STRUCT_PACKPUSH
  107.     #pragma pack(pop)
  108. #elif PRAGMA_STRUCT_PACK
  109.     #pragma pack()
  110. #endif
  111.  
  112. #ifdef PRAGMA_IMPORT_OFF
  113. #pragma import off
  114. #elif PRAGMA_IMPORT
  115. #pragma import reset
  116. #endif
  117.  
  118. #ifdef __cplusplus
  119. }
  120. #endif
  121.  
  122. #endif /* __CMSCRIPTINGPLUGIN__ */
  123.  
  124.